class Person(object):
    __slots__ = ("name", "age")

p = Person()
p.name = "ywc"
p.age = 20
# 不允许添加
p.score = 100

